import React, { useEffect, useState } from 'react'
import { Outlet } from "react-router-dom";
import { Layout } from '../web/layout';
import { webAddListener } from '../web/util';

export const MainPage: React.FC<{}> = ({ }) => {
  const [hasBack, setHasBack] = useState(false)
  useEffect(() => {
    webAddListener('HAS_BACK', (hasBack: boolean) => {
      setHasBack(!!hasBack)
    })
  }, [])
  return <Layout hasBack={hasBack}>
    <Outlet />
  </Layout>
}
